import { createRouter, createWebHashHistory } from "vue-router"

// import Home from "@/Views/Home.vue"
// import About from "@/Views/About.vue"

// const router = createRouter({
//   history: createWebHashHistory(),
//   routes: [
//     { path: "/home", component: Home},
//     {path: "/about", component: About}
//   ]
// })

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      redirect: "/home"
    },
    {
      name: "home",
      path: "/home",
      component: () => import("../Views/Home.vue"),
      children: [
        // {
        //   path: "/home",
        //   redirect: "/home/recommend"
        // },
        {
          path: "recommend",
          component: () => import("../Views/HomeRecommend.vue")
        },
        {
          path: "ranking",
          component: () => import("../Views/HomeRanking.vue")
        }
      ]
    },
    {
      name: "user",
      path: "/user/:id",
      component: () => import("../Views/User.vue")
    },
    {
      name: "about",
      path: "/about",
      component: () => import("../Views/About.vue")
    },
    
    {
      path: "/:pathMatch(.*)*",
      component: () => import("../Views/NotFound.vue")
    }
  ]
})

export default router